package com.spring.ioc.component;

import com.spring.ioc.model.Student;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class StudentComponent {
//    @Primary
    @Bean({"s3","s4"})
    public Student s1() {
        return new Student("zhangsan",13);
    }

    @Bean
    public String name() {
        return "lisi";
    }

    @Bean
    public String name2() {
        return "lisi2";
    }

    @Bean
    public Student s2(@Qualifier("name2") String n) {
        return new Student(n,23);
    }
}
